package com.jspx.io;

import com.jspx.boot.EnvFactory;
import com.jspx.boot.environment.EnvironmentTemplate;
import com.jspx.security.symmetry.AbstractEncrypt;
import com.jspx.security.symmetry.Encrypt;
import com.jspx.security.symmetry.impl.SM4Encrypt;
import com.jspx.security.utils.EncryptUtil;
import com.jspx.utils.ClassUtil;
import com.jspx.utils.StringUtil;
import org.slf4j.Logger;
import com.jspx.boot.environment.Environment;
import org.slf4j.LoggerFactory;

/**
 * Created by yuan on 2014/9/10 0010.
 *
 */
public class SecurityReadFile extends AutoReadTextFile
{
    final private static Logger log = LoggerFactory.getLogger(SecurityWriteFile.class);

    public SecurityReadFile()
    {

    }


    @Override
    public String getContent()
    {
        Encrypt encrypt = EnvFactory.getSymmetryEncrypt();
        StringBuilder sTmp  = new StringBuilder();
        try {
            sTmp.append(encrypt.getDecode(super.getContent()));
            return sTmp.toString();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return result.toString();
    }


}